package cn.pso.nspsofs;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;


public class Test_NSPSOFS {
    public static void main(String[] args) throws IOException {
        Process_NSPSOFS pso = new Process_NSPSOFS();
        Process_NSPSOFS.N_VAR = 20;
        Process_NSPSOFS.N_OBJ = 3;

        // 控制是否使用ncd
        pso.setEnableNcd(true);
        // 控制是否使用变异
        pso.setEnableMutate(true);
        // 控制使用什么函数
        pso.setFn(FN.WFG1);


        List<Particle_NSPSOFS> list = new ArrayList<>();

        for (int i = 0; i < 30; i++) {
            pso.init(30, "Hill_Valley");
            pso.run(5, i);
            pso.showResult(list);
            double igd = pso.calcIgd();
            System.out.println("NSPSOFS:" + Process_NSPSOFS.name + "第" + (i + 1) + "次测试完成, igd: " + igd);
        }
        SortBest_NSPSOFS sb = new SortBest_NSPSOFS();
        sb.getNSResult(Process_NSPSOFS.name, list, "All");
    }
}
